﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using System.IO;
using JumbotCms.Common;
namespace JumbotCms.WebFile.Admin
{
    public partial class _config_user : JumbotCms.API.AdminCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin_Load("0000", "html");
            if (!Page.IsPostBack)
            {
                string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/user.config");
                Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
                this.txtUserItem.Text = XmlTool.GetText("Root/UserItem");
                this.txtWriterItem.Text = XmlTool.GetText("Root/WriterItem");
                this.txtAdminGroupId.Text = XmlTool.GetText("Root/AdminGroupId");
                this.txtDefaultPoints.Text = XmlTool.GetText("Root/DefaultPoints");
                this.txtMaxSelected.Text = XmlTool.GetText("Root/MaxSelected");
                XmlTool.Dispose();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/user.config");
            Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
            XmlTool.Update("Root/UserItem", this.txtUserItem.Text);
            XmlTool.Update("Root/WriterItem", this.txtWriterItem.Text);
            XmlTool.Update("Root/AdminGroupId", this.txtAdminGroupId.Text);
            XmlTool.Update("Root/DefaultPoints", this.txtDefaultPoints.Text);
            XmlTool.Update("Root/MaxSelected", this.txtMaxSelected.Text);
            XmlTool.Save();
            XmlTool.Dispose();
            FinalMessage("保存成功!", "user.aspx", 0);
        }
    }
}
